package cn.cvs.controller;

import cn.cvs.pojo.StorageRecord;
import cn.cvs.service.StorageRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping("/record")
@Controller
public class StorageRecordController {
    @Autowired
    private StorageRecordService service;
    @RequestMapping("/list")
    public String List(Model model, String supName, String supCode, @RequestParam(required = false,defaultValue = "1") int pageIndex, @RequestParam(required = false,defaultValue = "3") int pageSize){
        StorageRecord record = new StorageRecord();
        List<StorageRecord> list = service.getList(record,pageIndex,pageSize);
        model.addAttribute("storageRecordList",list);
        return "/storageRecord/list";
    }
}
